<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="../../share/taglib.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>分类管理-列表</title>
<jsp:include page="../layout/_include.jsp" />

<script type="text/javascript">
<!--
$(document).ready(function(){
	$("div[id^=subSorts]").click(function(){
		var idStr = $(this).attr("id");
		var id = idStr.substring(8, idStr.length);
		var tr = $(this).parent().parent();
		var isShow = $(this).hasClass("up");
		if(!isShow){
			$.ajax({
				url:"getSortJson.do?id="+id,
				cache:false,
				dataType:'html',
				beforeSend:function(){
					$(this).removeClass("arrow").addClass("loading");
				},
				success:function(html){
					tr.after(html);
				},
				complete:function(){
					$(this).removeClass("loading").addClass("arrow");
				}
			});
		} else {
			tr.next("tr").remove();
		}
	    $(this).toggleClass("up");
	});
	
	/* $("#deleteSort").click(function(){
		if(confirm("确定删除?")){
			location.href = $(this).attr("id");
		}
	}); */
	
});
//-->
</script>

<style type="text/css">

</style>

</head>
<body>
<div id="body-wrapper">
  <!-- Wrapper for the radial gradient background and left menu-->
  <!-- left_menu -->
  <jsp:include page="left_menu.jsp" />
  <div id="main-content">
    <!-- Main Content Section with everything -->
    <!-- right head -->
    <jsp:include page="../layout/right_head.jsp" />
	<!-- End .clear -->
    <div class="clear"></div>
    <div class="content-box">
      <!-- Start Content Box -->
      <div class="content-box-header">
        <h3>分类列表</h3><a href="${ctx }/admin/gf/addSort.do" class="add_span">&gt;&nbsp;添加</a>
        <div class="clear"></div>
      </div>
      <!-- End .content-box-header -->
      <div class="content-box-content">
        <div class="tab-content default-tab">
        	<%-- <div class="search_form">
        	<form action="${ctx}/book_search.do" method="post">
        		书籍名称：<input type="text" name="keyword" />
        		<input type="submit" class="button" value="查询">
        	</form></div> --%>
          <table>
            <thead>
              <tr>
                <th width="3%"></th>
                <th width="10%">id</th>
                <th width="10%">pid</th>
                <th>分类名</th>
                <th width="10%">序号</th>
                <th width="15%">操作</th>
              </tr>
            </thead>
            <tbody>
            <c:forEach items="${gf_sort_list}" var="r" varStatus="i">
			<tr>
                <td>
                	<div id="subSorts${r.id}" class="arrow"></div>
                </td>
				<td>${r.id}</td>
				<td>${r.pid}</td>
				<td>${r.name }</td>
				<td>${r.order_by }</td>
				<td>
				<!-- Icons -->
				  <a href="${ctx }/admin/gf/editSort.do?id=${r.id}">编辑</a>|
				  <a href="${ctx }/admin/gf/addSubSort.do?id=${r.id }&height=200&width=300" class="thickbox" title="">添加子类</a>
				</td>
			</tr>
			</c:forEach>
            </tbody>
          </table>
          
        </div>
        <!-- End #tab1 -->
      </div>
      <!-- End .content-box-content -->
    </div>
    <!-- End .content-box -->
    <div class="clear"></div>
  </div>
</div>
</body>
</html>
